import * as types from './mutation-types'
import router from '../router'

const mutations = {
  /**
   * 处理菜单数据
   * 登录获取时 不传value参数
   * @param {*} state
   * @param {*} value
   */
  [types.SET_ASIDE_MENU] (state, menuList) {
    menuList && (state.menuList = menuList)
  },
  [types.LOGIN] (state, value) {
    state.username = value
    // localStorage.setItem('username', value.name)
    router.replace('/')
  }
}

export default mutations
